import axios from 'axios';

const BASE_URL = 'http://localhost:8080/deviceData';
// 获取最新数据
export function fetchLatestData() {
    return axios.get(`${BASE_URL}/fetchAndSave`);
}

// 获取历史数据
export function fetchHistoryData(dataType) {
    return axios.get(`${BASE_URL}/history`, { params: { dataType } });
}
